package com.zhoumengjie;

import com.alibaba.fastjson.JSON;
import netscape.javascript.JSObject;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.Reader;
import java.nio.charset.Charset;
import java.nio.charset.StandardCharsets;
import java.util.List;
import java.util.Scanner;

public class MyServlet extends HttpServlet {
    @Override
    protected void service(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        Reader reader=new InputStreamReader(req.getInputStream(),StandardCharsets.UTF_8);
        BufferedReader bufferedReader=new BufferedReader(reader);
        String str="";
        String result="";
        while((str=bufferedReader.readLine())!=null){
            result+=str;
        }
        System.out.println(result);
        List<Question> questions=JSON.parseArray(result,Question.class);
        System.out.println(questions.get(0).problem);
    }

}

class Question{
    public String problem;
    public int score;
    public Option[] options;
}

class Option{
    public String answer;
    public boolean checked;
}

